import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [{
            path: '/',
            redirect: '/dashboard'
        },
        {
            path: '/',
            component: resolve => require(['../components/common/Home.vue'], resolve),
            meta: { title: '自述文件' },
            children: [
                //用户管理
                {
                    path: '/ProcessDefinition',
                    component: resolve => require(['../components/page/ProcessDefinition.vue'], resolve),
                    meta: { title: '用户管理' }
                },
                //订单查询
                {
                    path: '/nodeExamine',
                    component: resolve => require(['../components/page/nodeExamine.vue'], resolve),
                    meta: { title: '订单查询' }
                },
                //代理商管理
                {
                    path: '/agent',
                    component: resolve => require(['../components/page/agent.vue'], resolve),
                    meta: { title: '代理商管理' }
                },
                //设备管理
                {
                    path: '/device',
                    component: resolve => require(['../components/page/device.vue'], resolve),
                    meta: { title: '设备管理' }
                },


                //所有未完成流程[只有管理可以查看
                {
                    path: '/notWorkFlow',
                    component: resolve => require(['../components/page/notWorkFlow.vue'], resolve),
                    meta: { title: '所有未完成流程[只有管理可以查看' }
                },

                //所有已完成流程[只有管理可以查看]
                {
                    path: '/maintain',
                    component: resolve => require(['../components/page/maintain.vue'], resolve),
                    meta: { title: '所有已完成流程[只有管理可以查看]' }
                },
                //设备轨迹
                {
                    path: '/selectFlowDispose',
                    component: resolve => require(['../components/page/selectFlowDispose.vue'], resolve),
                    meta: { title: '查询自己的流程该谁处理了' }
                },
                //服务管理
                {
                    path: '/historicalProcess',
                    component: resolve => require(['../components/page/historicalProcess.vue'], resolve),
                    meta: { title: '自己发布的历史流程' }
                },
                //财务管理
                {
                    path: '/finance',
                    component: resolve => require(['../components/page/finance.vue'], resolve),
                    meta: { title: '财务管理' }
                },

                //财务管理
                {
                    path: '/finance',
                    component: resolve => require(['../components/page/finance.vue'], resolve),
                    meta: { title: '财务管理' }
                },
                //代理商收费规则
                {
                    path: '/agentpayrule',
                    component: resolve => require(['../components/page/agentpayrule.vue'], resolve),
                    meta: { title: '代理商收费规则' }
                },
                //折扣规则
                {
                    path: '/discountrule',
                    component: resolve => require(['../components/page/discountrule.vue'], resolve),
                    meta: { title: '折扣规则' }
                },
                //员工管理
                {
                    path: '/staff',
                    component: resolve => require(['../components/page/staff.vue'], resolve),
                    meta: { title: '员工管理' }
                },
                //工作订单
                {
                    path: '/workFlow',
                    component: resolve => require(['../components/page/workFlow.vue'], resolve),
                    meta: { title: '查询历史流程' }
                },
                //维护费用
                {
                    path: '/maintainpayrule',
                    component: resolve => require(['../components/page/maintainpayrule.vue'], resolve),
                    meta: { title: '维护费用' }
                },
                //设备监控记录
                {
                    path: '/devicemonitorhistory',
                    component: resolve => require(['../components/page/devicemonitorhistory.vue'], resolve),
                    meta: { title: '设备监控记录' }
                },
                //设备异常记录
                {
                    path: '/devicemonitorexception',
                    component: resolve => require(['../components/page/devicemonitorexception.vue'], resolve),
                    meta: { title: '设备异常记录' }
                },
                //工作内容
                {
                    path: '/workcontent',
                    component: resolve => require(['../components/page/workcontent.vue'], resolve),
                    meta: { title: '工作内容' }
                },
                //水类型
                {
                    path: '/userPermission',
                    component: resolve => require(['../components/page/userPermission.vue'], resolve),
                    meta: { title: 'userPermission' }
                },
                //维修工管理
                {
                    path: '/maintainManage',
                    component: resolve => require(['../components/page/maintainManage.vue'], resolve),
                    meta: { title: '维修工管理' }
                },
                //权限管理
                {
                    path: '/jurisdictionManage',
                    component: resolve => require(['../components/page/jurisdictionManage.vue'], resolve),
                    meta: { title: '权限管理' }
                },
                //水量
                {
                    path: '/adminPermission',
                    component: resolve => require(['../components/page/adminPermission.vue'], resolve),
                    meta: { title: 'adminPermission' }
                },
                //常量
                {
                    path: '/globalParameter',
                    component: resolve => require(['../components/page/globalParameter.vue'], resolve),
                    meta: { title: '系统变量' }
                },
                {
                    path: '/404',
                    component: resolve => require(['../components/page/404.vue'], resolve),
                    meta: { title: '404' }
                },
                {
                    path: '/403',
                    component: resolve => require(['../components/page/403.vue'], resolve),
                    meta: { title: '403' }
                }
            ]
        },
        {
            path: '/login',
            component: resolve => require(['../components/page/Login.vue'], resolve)
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
})
